package cn.js.sangu.unitStore.entity;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import cn.hutool.core.annotation.Alias;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 系统设置实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("setting")
public class Setting implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 设置ID */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /** 设置键名 */
    @TableField(value = "k")
    private String k;

    /** 设置值 */
    @TableField(value = "v")
    private String v;

    /** 所属模块 */
    private String module;

    /** 设置描述 */
    private String description;

    /** 设置类型：boolean, number, string */
    private String type;

    @Alias("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date creatTime;

    @Alias("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date updateTime;

}
